<template>
  <div class="main-right">
    <div class="f-16 c_text2 mb-16 fw-6">自动回复</div>
    <div class="wrap">
      <div class="block">
        <div class="left"><el-switch size="small" /></div>
        <div class="right">
          <span class="title">排队话术设置</span>
          <el-input
            class="textareaInput"
            type="textarea"
            :rows="2"
            v-model="setValue"
            :disabled="!blockStatus"
            placeholder="请输入内容"
            maxlength="100"
            show-word-limit
            />
          <div class="tips">进入排队时的话术，开启后在被客服接入前，客户再次发送消息会再次触发</div>
          <div class="row-item">
            <el-checkbox checked style="margin-right: 4px;"/>
            同一用户在
            <el-input size="small" class="input" :disabled="!blockStatus" />
            分钟内发消息，不会重复发送
          </div>
          <div class="bts">
            <div class="flex-btn" v-if="blockStatus">
              <div @click.stop='onTiggerBockOne(false)'>取消</div>
              <div @click.stop='onTiggerBockOne(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockOne(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>

      <div class="block">
        <div class="left"><el-switch size="small" /></div>
        <div class="right">
          <span class="title">结束话术设置</span>
          <el-input
            class="textareaInput"
            type="textarea"
            :rows="2"
            v-model="setValue1"
            :disabled="!blockStatus"
            placeholder="请输入内容"
            maxlength="100"
            show-word-limit
            />
          <div class="tips">客服手动结束时，系统自动向顾客发送一段结束语</div>
          <el-input
            class="textareaInput"
            type="textarea"
            :rows="2"
            v-model="setValue2"
            :disabled="!blockStatus"
            placeholder="请输入内容"
            maxlength="100"
            show-word-limit
            />
          <div class="tips">对话超时自动结束时，系统自动向顾客发送一段结束语</div>
          <div class="bts">
            <div class="flex-btn" v-if="blockStatus">
              <div @click.stop='onTiggerBockOne(false)'>取消</div>
              <div @click.stop='onTiggerBockOne(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockOne(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>

      <div class="block">
        <div class="left"><el-switch size="small" /></div>
        <div class="right">
          <span class="title">结束话术设置</span>
          <div class="tips">客服手动结束时，系统自动向顾客发送一段结束语</div>
          <el-input
            class="textareaInput"
            type="textarea"
            :rows="2"
            v-model="setValue2"
            :disabled="!blockStatus"
            placeholder="请输入内容"
            maxlength="100"
            show-word-limit
            />
          <div class="bts">
            <div class="flex-btn" v-if="blockStatus">
              <div @click.stop='onTiggerBockOne(false)'>取消</div>
              <div @click.stop='onTiggerBockOne(false)'>保存</div>
            </div>
            <div class="flex-btn" v-else>
              <div @click='onTiggerBockOne(true)'>修改</div>
            </div>
          </div>
        </div>
      </div>

    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      setValue: '【系统消息】抱歉，当前所有客服都已达服务上限，请稍等。',
      setValue1: '【系统消息】您好，为了保证服务质量，我们已经结束了对话，期待再次为您服务。',
      setValue2: '【系统消息】您好，由于很久没有收到您的消息，系统自动结束了对话。如果还有需要，欢迎随时联系我们。',
      switchType: false,
      blockStatus: false,
      blockTwo: false,
      blockThree: false
    };
  },
  methods: {
    onTiggerBockOne(status) {
      this.blockStatus = status
    },
    onTiggerBockTwo(status) {
      this.blockTwo = status
    },
    onTiggerBockThree(status) {
      this.blockThree = status
    }
  },
};
</script>
<style lang="scss" scoped>
.wrap {
  .block {
    position: relative;
    padding: 16px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
    margin-bottom: 16px;
    display: flex;
    .left {
      margin-right: 20px;
    }
    .right {
      .title {
        display: block;
        font-size: 14px;
        font-weight: 600;
        color: rgba(0, 0, 0, .85);
        line-height: 22px;
        margin-bottom: 12px;
      }
      .row-item {
        display: flex;
        align-items: center;
        color: rgba(0, 0, 0, .65);
        font-size: 14px;
        margin-bottom: 20px;
        .input {
          width: 100px;
          margin: 0 4px;
        }
      }
      .bts {
        position: absolute;
        right: 16px;
        top: 16px;
        .flex-btn {
          display: flex;
          align-items: center;
          div {
            display: block;
            color: #3070ff;
            cursor: pointer;
            font-size: 14px;
            line-height: 22px;
            &:not(:first-child) {
              margin-left: 14px;
            }
          }
        }
      }
      .textareaInput {
        width: 600px;
      }
      .tips {
        font-size: 12px;
        font-weight: 400;
        color: rgba(0, 0, 0, .45);
        line-height: 20px;
        margin-top: 8px;
        margin-bottom: 16px;
      }
    }
  }
}
</style>